package UnOfficeDeTourisme;

/**
 * Interface definition : SGAssistanceVisiteur
 * 
 * @author OpenORB Compiler
 */
public class _SGAssistanceVisiteurStub extends org.omg.CORBA.portable.ObjectImpl
        implements SGAssistanceVisiteur
{
    static final String[] _ids_list =
    {
        "IDL:UnOfficeDeTourisme/SGAssistanceVisiteur:1.0"
    };

    public String[] _ids()
    {
     return _ids_list;
    }

    private final static Class _opsClass = UnOfficeDeTourisme.SGAssistanceVisiteurOperations.class;

    /**
     * Operation listerVisitesProche
     */
    public UnOfficeDeTourisme.Visite[] listerVisitesProche(int idTouriste, UnOfficeDeTourisme.GPS gps)
        throws UnOfficeDeTourisme.ListeVideException
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("listerVisitesProche",true);
                    _output.write_long(idTouriste);
                    UnOfficeDeTourisme.GPSHelper.write(_output,gps);
                    _input = this._invoke(_output);
                    UnOfficeDeTourisme.Visite[] _arg_ret = UnOfficeDeTourisme.listeVisitesHelper.read(_input);
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    if (_exception_id.equals(UnOfficeDeTourisme.ListeVideExceptionHelper.id()))
                    {
                        throw UnOfficeDeTourisme.ListeVideExceptionHelper.read(_exception.getInputStream());
                    }

                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("listerVisitesProche",_opsClass);
                if (_so == null)
                   continue;
                UnOfficeDeTourisme.SGAssistanceVisiteurOperations _self = (UnOfficeDeTourisme.SGAssistanceVisiteurOperations) _so.servant;
                try
                {
                    return _self.listerVisitesProche( idTouriste,  gps);
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation calculerItineraire
     */
    public float calculerItineraire(int idSite, UnOfficeDeTourisme.GPS gps, UnOfficeDeTourisme.mode m)
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("calculerItineraire",false);
                    _output.write_long(idSite);
                    UnOfficeDeTourisme.GPSHelper.write(_output,gps);
                    UnOfficeDeTourisme.modeHelper.write(_output,m);
                    _input = this._invoke(_output);
                    float _arg_ret = _input.read_float();
                    return _arg_ret;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("calculerItineraire",_opsClass);
                if (_so == null)
                   continue;
                UnOfficeDeTourisme.SGAssistanceVisiteurOperations _self = (UnOfficeDeTourisme.SGAssistanceVisiteurOperations) _so.servant;
                try
                {
                    return _self.calculerItineraire( idSite,  gps,  m);
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

}
